//
//  ConfigCellAttributeView.m
//  JinganMindCloud
//
//  Created by JinganMac on 2020/7/31.
//  Copyright © 2020 JingAn. All rights reserved.
//

#import "ConfigCellAttributeView.h"

@interface ConfigCellAttributeView ()

@property (nonatomic, strong) UILabel *leftTitleView;
@property (nonatomic, strong) UILabel *circelLabel;
@property (nonatomic, strong) UILabel *rightContentView;
@end

@implementation ConfigCellAttributeView


- (instancetype)init
{
    self = [super init];
    if (self) {
        [self addSubview:self.leftTitleView];
        [self addSubview:self.circelLabel];
        [self addSubview:self.rightContentView];
    }
    return self;
}

-(void)layoutSubviews{
    [_leftTitleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.mas_equalTo(self);
        make.width.mas_equalTo(self.leftViewWidth);
    }];
    
    [_circelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(6, 6));
        make.centerY.mas_equalTo(self);
        make.left.mas_equalTo(self.leftTitleView.mas_right);
    }];
    
    [_rightContentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.top.bottom.mas_equalTo(self);
        make.left.mas_equalTo(self.circelLabel.mas_right).offset(5);
    }];
    
}

-(UILabel *)leftTitleView{
    if (!_leftTitleView) {
        _leftTitleView = [UILabel new];
        _leftTitleView.textColor = [UIColor colorWithHexString:@"#AEAEAE"];
        _leftTitleView.font = [UIFont systemFontOfSize:13.];
        _leftTitleView.numberOfLines = 0;
    }
    return _leftTitleView;
}

-(UILabel *)circelLabel{
    if (!_circelLabel) {
        _circelLabel = [UILabel new];
        _circelLabel.backgroundColor = [UIColor blackColor];
        _circelLabel.layer.cornerRadius = 3.0;
        _circelLabel.layer.masksToBounds = YES;
    }
    return _circelLabel;
}

-(UILabel *)rightContentView{
    if (!_rightContentView) {
        _rightContentView = [UILabel new];
        _rightContentView.textColor = [UIColor colorWithHexString:@"#535353"];
        _rightContentView.font = [UIFont systemFontOfSize:13.];
        _rightContentView.numberOfLines = 0;
    }
    return _rightContentView;
}

-(void)setViewConfiSets:(CellSubViewsConfigSetting *)viewConfiSets{
    self.leftTitleView.text = viewConfiSets.cTitleValue;
    
}

-(void)setBaseVaule:(NSString *)baseVaule{
    self.rightContentView.text = baseVaule;
}

-(void)setHexColorString:(NSString *)hexColorString{
    self.circelLabel.backgroundColor = [UIColor colorWithHexString:hexColorString];
}


@end
